Popular Searches
Popular Course Categories
Popular Courses

Filtering Data at the Data Source Level

Filtering Data at the Data Source Level

Data Preparation and Management

Filtering Data at the Data Source Level in Tableau

Definition: Data source filtering in Tableau is the process of restricting the data available from a data source before it is used for analysis in worksheets and dashboards. It helps control which records are included in the analysis, reduce unnecessary data, improve performance in suitable scenarios, and provide a consistent subset of data across workbook views.

Example: A company has sales data for India, the USA, the UK, and Canada. If the report should contain only Indian sales, a data source filter can restrict the data to the India region.

Course: JustAcademy Tableau Training

Course Demo: Register for a Tableau Course Demo


1. What Is a Data Source Filter?

A data source filter is a filter applied to a Tableau data source. It limits the records available to analyses that use that source. Unlike a typical worksheet filter, which is configured for a particular view unless applied more broadly, a data source filter establishes a restriction at the data source level.

For example, suppose a company has a dataset containing 100,000 sales records from multiple countries. If the business needs reports only for India, you can create a data source filter on the Country field and include India.

Example Data

Order ID Country Category Sales
1001 India Technology ₹25,000
1002 USA Furniture ₹18,000
1003 India Office Supplies ₹12,000
1004 UK Technology ₹30,000
1005 India Furniture ₹20,000

If the Country filter includes only India, the available records will be:

Order ID Country Category Sales
1001 India Technology ₹25,000
1003 India Office Supplies ₹12,000
1005 India Furniture ₹20,000

The USA and UK records are excluded by this filter from analyses using the filtered data source.


2. Why Use Data Source Filters?

  • Restrict available data: Keep analysis focused on the records needed for a project.
  • Improve performance: Limiting records may reduce the amount of data Tableau needs to process, depending on the connection and query.
  • Maintain consistency: Apply a common data restriction to worksheets that use the same filtered data source.
  • Support publishing requirements: A published data source can provide users with a predefined subset of data.
  • Support data governance: Restrict the dataset available for particular reporting needs. For sensitive data, combine this with appropriate permissions and security controls.
  • Focus on relevant dates or categories: For example, include only the current financial year or selected business units.

3. Data Source Filters vs. Worksheet Filters

Basis Data Source Filter Worksheet Filter
Application level At the data source level At the worksheet/view level by default
Purpose Restricts data available to analyses using the source Controls which data appears in a particular view
Scope Can affect multiple worksheets using the filtered source Usually affects the current worksheet unless applied to other worksheets
Visibility Not normally displayed as a filter card on the worksheet Can be displayed as an interactive filter card
Typical example Include only India records for a regional reporting source Let viewers select a product category in a chart
Best use Establish a shared restriction on available data Explore or present different subsets in a view

4. Prerequisites

  • Tableau Desktop or a supported Tableau authoring environment.
  • A connected data source, such as Excel, CSV, or a database.
  • A field that can be used to filter records, such as Country, Region, Category, Order Date, or Sales.
  • A clear requirement specifying which records should remain available.

5. How to Create a Data Source Filter

Method 1: From the Data Source Page

  1. Open Tableau and connect to your dataset.
  2. Open the Data Source tab.
  3. Locate the Filters section, usually in the upper-right area of the page.
  4. Click Add.
  5. In the data source filter dialog, click Add to choose a field.
  6. Select the field you want to filter, such as Country.
  7. Choose the required values or conditions.
  8. Click OK to confirm the filter.
  9. Review the filter's scope if the dialog provides a scope option for the data model.
  10. Open a worksheet and verify that only the intended records are available.

Method 2: From a Worksheet

  1. Open a worksheet using the relevant data source.
  2. Locate the data source at the top of the Data pane.
  3. Right-click the data source. On a Mac, Control-click it.
  4. Select Edit Data Source Filters.
  5. Click Add and select the field to filter.
  6. Configure the filter condition and select the required values.
  7. Click OK to apply the changes.
  8. Check the worksheet to confirm the expected records are available.

Note: The exact options may vary by Tableau version and connector. Tableau's official guide explains both ways to create data source filters: Filter Data from Data Sources — Tableau Help.


6. Example: Filter Sales Data by Country

Imagine a sales analyst is preparing a report for the India business team. The original dataset includes sales records from four countries, but only Indian records are needed.

Steps

  1. Connect Tableau to the sales dataset.
  2. Open the Data Source page.
  3. Click Add in the Filters section.
  4. Choose the Country field.
  5. Select India as the value to include.
  6. Confirm the filter and open a worksheet.
  7. Create a bar chart with Category and Sales.
  8. Verify that the resulting chart uses the India subset.

Expected Result

The analysis uses Indian sales records rather than the full international dataset. If the workbook contains multiple worksheets using this same filtered source, the restriction applies to those analyses as well.


7. Common Types of Data Source Filter Conditions

A. Dimension Filters

Dimension filters commonly restrict text or categorical fields such as Country, Region, Category, Department, or Customer Segment.

Example: Include only the Technology and Furniture categories.

B. Date Filters

Date filters can restrict records to a particular date, range, or relative period.

Example: Include orders from the current financial year. Ensure that the date range matches the business's financial-year definition.

C. Measure or Numeric Filters

Numeric conditions can limit data using fields such as Quantity, Sales, Profit, or Discount, depending on the available field and filter options.

Example: Include records where Sales is greater than ₹10,000.

D. Table-Specific and Related-Table Scope

In data models with related tables, Tableau may allow a data source filter to apply only to the selected logical table or to that table and its related tables. Choose the scope carefully because it affects which related data is restricted.


8. Data Source Filters and Extract Filters

These are related concepts, but they are not identical.

Feature Data Source Filter Extract Filter
Main purpose Restricts data available to analyses using the data source Limits the data included when creating or refreshing an extract
Connection context Can be used with supported live or extract data sources Applies to extract-based data sources
Effect on data Applies a restriction to queries and analysis using that source Can reduce the rows stored in the extract
Typical example Keep reports focused on India sales Store only the required years of sales data in an extract

Important: Do not assume that a data source filter always reduces the physical size of an extract. If reducing the extract itself is the goal, configure and verify the extract filter behavior for your data source and connection type.


9. Data Source Filter Scope and Related Tables

When a data model includes multiple related logical tables, scope determines how widely a filter applies.

  • Table only: Restricts the selected logical table.
  • Table and all related tables: Applies the filter to the selected table and carries the restriction through related tables.

The available choices depend on the data model, field dependencies, and Tableau version. Some filters, such as calculations that reference multiple tables, may require a broader scope.

Practical tip: After adding a filter, test worksheets that use related tables to make sure the filter produces the expected results.


10. Benefits and Limitations

Benefits

  • Creates a common restriction for analyses that use the same filtered data source.
  • Can help simplify workbook design by removing irrelevant records from the analysis scope.
  • May improve query efficiency when the underlying connection can take advantage of the restriction.
  • Can support controlled data delivery when used with publishing permissions and governance policies.

Limitations and Considerations

  • Records excluded by a data source filter are not available to normal analyses using that filtered source.
  • Users may not see the data source filter as a worksheet filter card.
  • Performance improvements depend on the database, connection type, query plan, and data volume.
  • Changing a shared data source filter can change the results of multiple worksheets or reports.
  • A data source filter alone should not be treated as a complete security system. Review permissions, publishing settings, and row-level security requirements.

11. Common Mistakes and Troubleshooting

Problem Possible Cause Solution
No records appear The selected values or conditions exclude all records Reopen the filter and verify the values and conditions
Some expected records are missing The data source filter excludes those records Review all active data source filters and their conditions
A related table behaves unexpectedly The filter scope does not match the intended data model behavior Review the table-only or table-and-related-tables scope
A worksheet does not show the filter card Data source filters are not normally displayed as worksheet filter cards Check the data source filter configuration rather than expecting a visible card
Performance does not improve The connection or query plan may not benefit from the restriction Test query performance and inspect the underlying data source
Published users can access unexpected data Permissions or security configuration may be insufficient Review published data source permissions and row-level security controls

12. Practical Exercise

Task: Create a data source filter for a sales dataset so that only orders from the year 2025 and the country India are available to the analysis.

Instructions

  1. Connect Tableau to a sales dataset containing Order Date, Country, Category, and Sales.
  2. Create a data source filter on Country and include India.
  3. Create a date filter on Order Date that covers January 1, 2025, through December 31, 2025.
  4. Open a worksheet and build a chart showing Sales by Category.
  5. Check that the worksheet uses only records meeting both conditions.
  6. Create another worksheet using the same data source and verify that the restrictions remain in effect.

Expected Learning Outcome

You should be able to create multiple data source filters, verify their combined effect, and explain how they differ from worksheet filters.


13. Interview Questions and Answers

Q1. What is a data source filter in Tableau?

A data source filter restricts the data available to analyses using a particular data source.

Q2. Why are data source filters used?

They help restrict irrelevant data, maintain a common data scope across worksheets, and may improve performance in suitable environments.

Q3. How do you create a data source filter?

Open the Data Source page and click Add in the Filters section, or right-click the data source in the Data pane and choose Edit Data Source Filters.

Q4. What is the difference between a data source filter and a worksheet filter?

A data source filter restricts the data available to analyses using the source, while a worksheet filter normally controls the data displayed in a particular view.

Q5. Can one data source filter affect multiple worksheets?

Yes. Worksheets that use the same filtered data source are affected by its restrictions.

Q6. Does a data source filter always reduce extract file size?

No. To reduce the data physically stored in an extract, check and configure the relevant extract filtering options.

Q7. Can data source filters help with data security?

They can help provide a restricted subset of data, particularly in published data sources. However, proper permissions and security controls are also important.

Q8. What is filter scope in a multi-table data model?

Scope controls whether a data source filter applies only to one logical table or to that table and its related tables.

Q9. What should you check if expected data is missing?

Review active filters, selected values, date ranges, and the filter scope.

Q10. Where can you read the official Tableau instructions?

Refer to Tableau Help: Filter Data from Data Sources.


14. Quick Revision Checklist

  • Understand what a data source filter does.
  • Know how to add a filter from the Data Source page.
  • Know how to edit data source filters from the Data pane.
  • Practice filtering by country, category, date, and numeric conditions.
  • Understand the difference between data source filters and worksheet filters.
  • Understand data source filters versus extract filters.
  • Review table scope when working with related logical tables.
  • Test multiple worksheets after changing a shared filter.
  • Review permissions and security controls before publishing restricted data.

15. Learning Resources

Conclusion

Filtering data at the data source level is an important Tableau skill for defining which records are available for analysis. By choosing the right fields, conditions, and scope, you can create more focused and consistent reports. Always verify the results across worksheets and use appropriate publishing permissions and security controls when working with restricted business data.

whatsapp